<?php
namespace app\admin\controller;

class Base extends \think\Controller
{
	public $admin;
    function initialize(){
        if (!cookie('admin_id')) {
            $this->redirect('index/login');
        }
		$this->admin=db_find("admin","id=".decrypt(\cookie('admin_id')));
		$this->assign("admin",$this->admin);
		if(empty($this->admin)){
			$this->redirect('index/login');
		}
    }
}
